package io.yuncheng.common.config;

import com.google.common.collect.Maps;
import org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 页面跳转
 *
 * @Author shouxu
 * @Date 2020/11/24 11:03
 */
@Component
public class RenrenErrorResolver implements ErrorViewResolver {
    @Override
    public ModelAndView resolveErrorView(HttpServletRequest request, HttpStatus status, Map<String, Object> model) {
        return new ModelAndView("redirect:/", Maps.newHashMap());
    }
}
